#!/bin/bash
###
 # @Author: Logan.Li
 # @Gitee: https://gitee.com/attacker
 # @email: admin@attacker.club
 # @Date: 2025-03-02 22:27:02
 # @LastEditTime: 2025-03-02 22:27:08
 # @Description: 
### 

# 确保传入 S3 目标桶
if [ -z "$1" ]; then
  echo "Usage: $0 <target-s3-bucket>"
  exit 1
fi

TARGET_BUCKET=$1
LOCAL_DIR="/tmp/s3-download"

echo "🔼 上传本地目录: $LOCAL_DIR 到 S3 Bucket: $TARGET_BUCKET"

# 执行 S3 同步上传，并确保当前账户有完整权限
aws s3 sync "$LOCAL_DIR" "s3://$TARGET_BUCKET" --acl bucket-owner-full-control

echo "✅ 上传完成！"
